home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Diamond Collection / The Diamond Collection (Software Vault)(Digital Impact).ISO / cdr13 / aurora2c.zip / BRKBD.AML < prev    next >
Text File  |  1995-04-07  |  23KB  |  639 lines

  1.  
  2. // ───────────────────────────────────────────────────────────────────
  3. // The Aurora Editor v2.0
  4. // Copyright 1993-1995 nuText Systems. All Rights Reserved Worldwide.
  5. //
  6. // Brief Keyboard definitions (included by MAIN.AML)
  7. //
  8. // If you have made any changes, save this file and select 'Recompile
  9. // the Editor' from the Set menu. Exit and re-enter the editor for
  10. // your changes to take effect.
  11. // ───────────────────────────────────────────────────────────────────
  12.  
  13. // ───────────────────────────────────────────────────────────────────
  14. //  Edit and File Manager windows
  15. // ───────────────────────────────────────────────────────────────────
  16.  
  17.   object  edit_fmgr
  18.  
  19.   // Controls
  20.   function  '≡'                                // close window
  21.     close
  22.   end
  23.  
  24.   // Menu activation
  25.   key  <esc>           gotobar                 // to last menu bar item (br)
  26.   key  <f10>           gotobar                 // to last menu bar item (br)
  27.   key  <alt h>         gotomenu "help"         // goto help pull-down menu (br)
  28.  
  29.   // Scroll
  30.   key  <pgdn>          pagedown                // scroll down (br)
  31.   key  <pgup>          pageup                  // scroll up (br)
  32.   key  <ctrl home>     row (getviewtop)        // to page top (br)
  33.   key  <ctrl end>      row (getviewbot)        // to page bottom (br)
  34.   key  <ctrl pgup>     row 1                   // to file top (br)
  35.   key  <ctrl pgdn>     row (getlines)          // to file bottom (br)
  36.   key  <ctrl c>        adjustrow               // center cursor (br)
  37.   key  <ctrl t>        adjustrow 1             // scroll to page top (br)
  38.   key  <ctrl b>        adjustrow (getviewrows) // scroll to page bottom (br)
  39.  
  40.   // scroll up one line (br)
  41.   key  <ctrl e>
  42.     rollrow -1
  43.     if getrow < getviewbot then
  44.       down
  45.     end
  46.   end
  47.  
  48.   // scroll down one line (br)
  49.   key  <ctrl d>
  50.     rollrow 1
  51.     if getrow > getviewtop then
  52.       up
  53.     end
  54.   end
  55.  
  56.   // File
  57.   key  <ctrl n>        opennew                 // new edit window
  58.   key  <alt e>         askopen                 // open prompt (br)
  59.   key  <alt b>         filelist                // file list (br)
  60.   key  <ctrl ->        close                   // close window (br)
  61.   key  <alt x>         closeall                // close all windows (br)
  62.   key  <shift f1>      quickref 'qw'           // quick function reference
  63.   key  <shift f2>      quickref 'fw'           // function reference
  64.  
  65.   // Window
  66.   key  <f1>            winlist                 // window list
  67.   key  <ctrl z>        maximize                // maximize window (br)
  68.   key  <alt f2>        maximize                // maximize window (br)
  69.   key  <ctrl a>        nextwindow              // next window
  70.   key  <f12>           prevwindow              // prev window
  71.   key  <shift f3>      tile 'v'                // tile vertical
  72.   key  <shift f4>      tile 'h'                // tile horizontal
  73.   key  <shift f5>      cascade                 // cascade
  74.   key  <ctrl o><q>     close                   // close window
  75.  
  76.   // Search
  77.   key  <ctrl s>        askscan                 // file scan prompt
  78.   key  <ctrl 6>        cyclebook               // cycle through bookmarks
  79.  
  80.   // go to bookmark
  81.   key  <alt j>         askbook "Go to bookmark [0-9]"
  82.  
  83.   // Print
  84.   key  <ctrl p>        print                   // print
  85.   key  <alt p>         print 'b'               // print block (br)
  86.  
  87.   // Set
  88.   key  <ctrl f1>       togglemode              // toggle video mode
  89.  
  90.   // Macro
  91.   key  <alt f7>        askopenkey              // open key macro (br)
  92.   key  <alt f8>        asksavekey              // save key macro (br)
  93.   key  <ctrl v>        askeval                 // macro command prompt
  94.   key  <alt f9>        askrun                  // DOS command prompt
  95.   key  <alt z>         shell                   // exit to DOS (br)
  96.  
  97.   // display version
  98.   key  <alt v>         say "Version is: " + getversion
  99.  
  100.   // undefined or unnamed keys
  101.   key <otherkey> (keycode)
  102.     say  (getkeyname (keycode)) + " not defined "
  103.   end
  104.  
  105.  
  106. // ───────────────────────────────────────────────────────────────────
  107. //  Prompts and Edit windows
  108. // ───────────────────────────────────────────────────────────────────
  109.  
  110.   object  prompt
  111.  
  112.   // Controls
  113.   function  '≡'                                // close window
  114.     close
  115.   end
  116.  
  117.   function  '*'                                // simulate <enter>
  118.     call <enter>                               //  (2-line box only)
  119.   end
  120.  
  121.   // Cursor
  122.   key  <left>          left                    // move cursor left (br)
  123.                        smark                   // cua marking
  124.  
  125.   key  <right>         right                   // move cursor right (br)
  126.                        smark                   // cua marking
  127.  
  128.   key  <home>          col 1                   // to column one (br)
  129.                        smark                   // cua marking
  130.  
  131.   key  <end>           col  getlinelen + 1     // to end of line (br)
  132.                        smark                   // cua marking
  133.  
  134.   // Scroll
  135.   key  <alt left>      rollcol -(getviewcols - 1)   // page left
  136.   key  <alt right>     rollcol   getviewcols - 1    // page right
  137.  
  138.   // Editing
  139.   key  <alt i>         setting 'I' TOGGLE      // toggle insert mode (br)
  140.  
  141.   // delete character/block (br)
  142.   key  <del>
  143.     if getmarkbuf == getcurrbuf then
  144.       deleteblock2
  145.     else
  146.       if wintype? "edit" then
  147.         send "delchar2"
  148.       else
  149.         delchar
  150.       end
  151.     end
  152.   end
  153.  
  154.   key  <backspace>     backsp                  // delete left character (br)
  155.   key  <alt k>         delchar (getlinelen)    // erase to end of line (br)
  156.   key  <ctrl k>        delchar getcol - 1 1    // erase to beginning of line (br)
  157.   key  <alt q>         literal                 // enter literal character (br)
  158.   key  <alt =>         asciilist               // display ascii chart
  159.  
  160.   // Block
  161.   key  <alt a>         destroymark             // mark character (br)
  162.                        markchar
  163.  
  164.   key  <alt c>         destroymark             // mark column (br)
  165.                        markcolumn
  166.  
  167.   key  <alt m>         destroymark             // mark stream (br)
  168.                        markstream
  169.  
  170.   // paste from clipboard to prompt (br)
  171.   key  <ins>
  172.                        usemark _ClipName
  173.                        instext (getmarktext)
  174.                        usemark
  175.                        col  getlinelen + 1
  176.  
  177.   // copy from prompt to clipboard (br)
  178.   key  <grey+>         copy
  179.  
  180.   // Prompt history
  181.   key  <up>            prevhist                // retrieve prev prompt
  182.   key  <down>          nexthist                // retrieve next prompt
  183.   key  <pgup>          askhistory              // history popup menu
  184.   key  <pgdn>          askhistory              // history popup menu
  185.  
  186.   // Exit
  187.   key  <esc>           close                   // quit prompt
  188.   key  <ctrl ->        close
  189.  
  190.   // non-function keys
  191.   key  <char> (character)                      // typeable keys
  192.     write character
  193.   end
  194.  
  195.   // filename completion
  196.   key  <ctrl tab>      askcomplete             // filename completion
  197.   key  <tab>           askcomplete             // filename completion
  198.   end
  199.  
  200.  
  201. // ───────────────────────────────────────────────────────────────────
  202. //  Edit windows
  203. // ───────────────────────────────────────────────────────────────────
  204.  
  205.   object  edit
  206.  
  207.   // Controls
  208.   function  '≡'
  209.     close                                      // close window
  210.   end
  211.  
  212.   // Menu
  213.   key  <esc>           gotobar                 // to last menu bar item (br)
  214.  
  215.   // Cursor
  216.   key  <up>            up                      // move cursor up (br)
  217.                        smark                   // cua marking
  218.  
  219.   key  <down>          down                    // move cursor down (br)
  220.                        smark                   // cua marking
  221.  
  222.   // brief <home> key emulation (br)
  223.   key <home>
  224.     col 1                                      // goto column 1
  225.     smark                                      // cua marking
  226.     keycode = getkey                           // get next key
  227.     if keycode == <home> then                  // <home> pressed 2nd time?
  228.       row (getviewtop)                         // goto to page top
  229.       smark                                    // cua marking
  230.       keycode = getkey                         // get next key
  231.       if keycode == <home> then                // <home> pressed 3rd time?
  232.         row 1                                  // goto to top of file
  233.         smark                                  // cua marking
  234.       else
  235.         queuekey keycode                       // execute key normally
  236.       end
  237.     else
  238.       queuekey keycode                         // execute key normally
  239.     end
  240.   end
  241.  
  242.   // brief <end> key emulation (br)
  243.   key <end>
  244.     col  getlinelen + 1                        // goto end-of-line
  245.     smark                                      // cua marking
  246.     keycode = getkey                           // get next key
  247.     if keycode == <end> then                   // <end> pressed 2nd time?
  248.       row (getviewbot)                         // goto to page bottom
  249.       smark                                    // cua marking
  250.       keycode = getkey                         // get next key
  251.       if keycode == <end> then                 // <end> pressed 3rd time?
  252.         row (getlines)                         // goto to bottom of file
  253.         smark                                  // cua marking
  254.       else
  255.         queuekey keycode                       // execute key normally
  256.       end
  257.     else
  258.       queuekey keycode                         // execute key normally
  259.     end
  260.   end
  261.  
  262.   key  <alt home>      col (getviewleft)       // leftedge (br)
  263.   key  <alt end>       col (getviewright)      // rightedge (br)
  264.  
  265.   key  <enter>         enter                   // enter key (br)
  266.   key  <greyenter>     enter                   // keypad enter key
  267.   key  <backspace>     backsp                  // delete left char (br)
  268.   key  <alt backspace> delword _CSet           // delete right word (br)
  269.   key  <tab>           tabright                // tab right (br)
  270.   key  <shift tab>     tableft                 // tab left (br)
  271.  
  272.   key  <ctrl left>     prevword                // find left word (br)
  273.                        smark
  274.  
  275.   key  <ctrl right>    nextword                // find right word (br)
  276.                        smark
  277.  
  278.   // Scroll
  279.   key  <pgdn>          pagedown                // scrolldown (br)
  280.                        display
  281.                        smark
  282.  
  283.   key  <pgup>          pageup                  // scrollup (br)
  284.                        display
  285.                        smark
  286.  
  287.   key  <ctrl home>     row (getviewtop)        // to page top (br)
  288.                        smark
  289.  
  290.   key  <ctrl end>      row (getviewbot)        // to page bottom (br)
  291.                        smark
  292.  
  293.   key  <ctrl pgup>     row 1                   // to file top (br)
  294.                        smark
  295.  
  296.   key  <ctrl pgdn>     row (getlines)          // to file bottom (br)
  297.                        smark
  298.  
  299.   // File
  300.   key  <alt r>         askinsert               // open and insert prompt (br)
  301.   key  <ctrl ]>        openword                // open file at cursor
  302.   key  <alt o>         askname                 // rename prompt (br)
  303.   key  <alt n>         nextfile                // next file (br)
  304.   key  <alt ->         prevfile                // prev file (br)
  305.   key  <ctrl ->        close                   // close file/window (br)
  306.   key  <ctrl x>        closeall 's'            // saveall & closeall (br)
  307.   key  <alt f>         say "File is: " + getbufname  // display filename (br)
  308.  
  309.   // Window
  310.  
  311.   // create window (br)
  312.   key  <f3>
  313.     say "Select side for new window (use cursor keys)"
  314.     case getkey
  315.       when <left>, <right>
  316.         splitwin 'v'
  317.       when <up>, <down>
  318.         splitwin 'h'
  319.     end
  320.     display
  321.   end
  322.  
  323.   // delete window (br)
  324.   key  <f4>
  325.     if getwincount > 1 then
  326.       deletewin
  327.     end
  328.   end
  329.  
  330.   key  <ctrl o><w>     copywin                 // copy window
  331.   key  <ctrl f8>       toolbar                 // display tool bar
  332.   key  <alt f1>        togglestyle             // toggle window style
  333.  
  334.   // Block
  335.   key  <alt l>         destroymark             // mark line (br)
  336.                        markline
  337.  
  338.   key  <ctrl o><d>     deleteblock2            // delete block
  339.   key  <shift f7>      shiftblock -1           // unindent block
  340.   key  <shift f8>      shiftblock  1           // indent block
  341.   key  <ctrl o><f>     fillblock2              // fill block with string
  342.   key  <ctrl o><r>     formatblock2 "kr"       // reformat block
  343.   key  <alt y>         formatblock2 "rj"       // reformat & right just block
  344.   key  <alt w>         saveblock2              // save block (br)
  345.   key  <ctrl o><s>     sortblock2              // sort block
  346.   key  <ctrl o><u>     caseblock               // change block to uppercase
  347.   key  <shift f9>      quote                   // quote a block
  348.   key  <ctrl k><c>     justblock2 'c'          // center a block
  349.  
  350.   // Search
  351.  
  352.   // brief-style find/replace (always uses command-line prompts)
  353.   function  findbr (tran reverse)
  354.     find_str = ask (if? reverse '' '') +
  355.                    (if? tran " Pattern:" " Search for:") "_find1" '' '' 'c'
  356.     if find_str then
  357.       addhistory "_find1" find_str
  358.       if tran then
  359.         tran_str = ask "Replacement:" "_find2" '' '' 'c'
  360.         if not tran_str then
  361.           return
  362.         end
  363.         addhistory "_find2" tran_str
  364.         search_str = joinstr '' find_str tran_str _SearchOpt + reverse
  365.         addhistory "_repl" search_str
  366.       else
  367.         search_str = joinstr '' find_str _SearchOpt + reverse
  368.       end
  369.       search2 search_str
  370.       addhistory "_find" search_str
  371.     end
  372.   end
  373.  
  374.   key  <f5>            findbr                  // search forward (br)
  375.   key  <alt s>         findbr                  // search forward (br)
  376.   key  <alt f5>        findbr '' 'r'           // search backward (br)
  377.   key  <shift f5>      findlast                // search again (br)
  378.  
  379.   key  <f6>            findbr 't'              // translate forward (br)
  380.   key  <alt t>         findbr 't'              // translate forward (br)
  381.   key  <alt f6>        findbr 't' 'r'          // translate backward (br)
  382.   key  <shift f6>                              // translate again (br)
  383.     search2 (gethiststr "_repl")
  384.   end
  385.  
  386.   // toggle a default search option
  387.   function  toggleopt (option)
  388.     search_opt = _SearchOpt
  389.     setobj _SearchOpt  (if pos option search_opt then
  390.                           sub option '' search_opt
  391.                         else
  392.                           search_opt + option
  393.                         end)  "prf"
  394.   end
  395.  
  396.   function  togglecase
  397.     toggleopt 'i'
  398.     say "Case sensitivity " + (if? (pos 'i' _SearchOpt) "Off" "On")
  399.   end
  400.  
  401.   function  toggleregx
  402.     toggleopt 'x'
  403.     say "Regular expressions " + (if? (pos 'x' _SearchOpt) "On" "Off")
  404.   end
  405.  
  406.   key  <ctrl f5>       togglecase              // case sens toggle (br)
  407.   key  <ctrl f6>       toggleregx              // reg expression toggle (br)
  408.  
  409.   key  <ctrl i>        isearch                 // incremental search
  410.   key  <ctrl h>        askfindo                // find occurrences
  411.  
  412.   // goto routine (br)
  413.   function  gotoroutine
  414.     string = case  getext (getbufname)
  415.                when ".C", ".CPP"
  416.                  "^[a-zA-Z_].*\(.*[~;]$"
  417.                when ".AML"
  418.                  "^ *{function}|{key}.*$"
  419.                when ".PAS"
  420.                  "{procedure}|{function} +[a-zA-Z_]"
  421.                when ".PRG", ".SPR", ".MPR", ".QPR", ".FMT", ".FRG", ".LBG", ".CH"
  422.                  "^{procedure}|{function} +[a-zA-Z_]"
  423.                otherwise
  424.                  ""
  425.              end
  426.     if string then
  427.       findo string + "/ix"
  428.     else
  429.       say "File extension not supported"
  430.     end
  431.   end
  432.  
  433.   key  <ctrl g>       gotoroutine              // goto language routine (br)
  434.  
  435.   // set bookmarks (br)
  436.   key  <alt 1>         placebook '1'
  437.   key  <alt 2>         placebook '2'
  438.   key  <alt 3>         placebook '3'
  439.   key  <alt 4>         placebook '4'
  440.   key  <alt 5>         placebook '5'
  441.   key  <alt 6>         placebook '6'
  442.   key  <alt 7>         placebook '7'
  443.   key  <alt 8>         placebook '8'
  444.   key  <alt 9>         placebook '9'
  445.   key  <alt 0>         placebook '0'
  446.  
  447.   key  <ctrl 2>        quickbook               // set quick bookmark
  448.   key  <alt g>         askrow                  // go to line prompt (br)
  449.   key  <ctrl [>        gotomatch2              // find matching char
  450.  
  451.   // Fold
  452.   key  <alt \>                                 // open or close fold
  453.     if fold? then
  454.        openfold
  455.     else
  456.        closefold
  457.     end
  458.   end
  459.   key  <alt [>         foldall 'os'            // open all folds
  460.   key  <alt ]>         foldall 'cs'            // close all folds
  461.  
  462.   // Edit
  463.   key  <alt u>         undo                    // undo last change (br)
  464.   key  <grey*>         undo                    // undo last change (br)
  465.   key  <ctrl u>        redo                    // undo last change (br)
  466.  
  467.   key  <ctrl enter>    insline                 // insert line (br)
  468.                        down
  469.                        col 1
  470.  
  471.   key  <alt d>         delline                 // delete line (br)
  472.  
  473.   key  <ctrl o><t>     timestamp               // date/time stamp
  474.   key  <ctrl o><x>     tabfile                 // expand tabs
  475.   key  <ctrl \>        hiliteword              // highlight words
  476.  
  477.   // Clipboard
  478.   key  <grey->         cut                     // cut (br)
  479.   key  <ctrl grey->    cut 'a'                 // cut append
  480.   key  <grey+>         copy                    // copy (br)
  481.   key  <ctrl grey+>    copy 'a'                // copy append
  482.   key  <ins>           paste                   // paste (br)
  483.   key  <ctrl grey*>    paste 'o'               // paste over
  484.   key  <ctrl grey/>    clear                   // clear clipboard
  485.  
  486.   // Set
  487.   key  <alt f3>        setting 'A' TOGGLE      // autoindent toggle (br)
  488.   key  <ctrl w>        setting 'B' TOGGLE      // toggle file backup (br)
  489.   key  <alt f4>        setting 'T' TOGGLE      // text translate toggle
  490.  
  491.   // Macro
  492.   key  <alt f10>       compilemacro2 (getbufname)  // compile current file (br)
  493.   key  <shift f11>     runmacro2 (getbufname)      // run current file
  494.   key  <shift f12>     pickmacro                   // macro picklist
  495.  
  496.   // non-function (typeable) keys
  497.   key  <char> (character)                      // typeable keys
  498.     write character
  499.   end
  500.  
  501.   // Other
  502.   key  <ctrl r>        askrepkey               // repeat entered keys (br)
  503.  
  504.   // invoke a spell checker from within an edit window
  505.   // (replace 'jspell ' with your favorite spell checker)
  506.   key  <f11>
  507.     save                                       // save the current file
  508.     run  "jspell " + getbufname  "ck"          // call spellchecker
  509.     reopen                                     // reopen current file
  510.   end
  511.  
  512.  
  513. // ───────────────────────────────────────────────────────────────────
  514. //  File Manager windows
  515. // ───────────────────────────────────────────────────────────────────
  516.  
  517.   object  fmgr
  518.  
  519.   // Menu activation
  520.   key  <tab>           gotobar2                // to drive menu bar
  521.  
  522.   // Cursor
  523.   key  <left>          rollcol -1              // scroll left one column
  524.   key  <right>         rollcol  1              // scroll right one column
  525.   key  <home>          col 1                   // scroll to column one
  526.  
  527.   // move cursor up
  528.   key  <up>
  529.     if shiftkey? then
  530.       fmark
  531.     end
  532.     up
  533.   end
  534.  
  535.   //move cursor down
  536.   key  <down>
  537.     if shiftkey? then
  538.       fmark
  539.     end
  540.     down
  541.   end
  542.  
  543.   // file manager commands (single character command codes)
  544.   key  <char> (c)
  545.  
  546.     // toggle file mark
  547.     if c == ' ' then
  548.       fmark
  549.  
  550.     // <shift-character> commands
  551.     elseif shiftkey? then
  552.       case  locase c
  553.         when 'o'     fopen 'o'                   // open file/directory
  554.         when 'e'     fopen 'e'                   // open file/directory
  555.         when 'z'     fopen "ze"                  // open maximized
  556.         when 'b'     fopen 'b'                   // open binary file
  557.         when 'y'     fopen "be"                  // open binary in one window
  558.         when 'k'     openkey2 (getffile)         // open key macro file
  559.         when 'm'     fmove                       // move file
  560.         when 'c'     fcopy                       // copy file
  561.         when 'd'     fdelete                     // delete file
  562.         when 'n'     frename                     // rename file
  563.         when 'r'     frun 'c'                    // run program/batch file
  564.         when 'p'     fprint                      // print file
  565.         when 'a'     fattr                       // change file attributes
  566.         when 't'     ftouch                      // touch file
  567.  
  568.         // spell checker
  569.         when 's'     run "jspell " + getffile  "ck"
  570.  
  571.         // unarchive .ZIP or .LZH files
  572.         when 'u'
  573.           f = getffile
  574.           run (if? (pos ".lzh" f 'i') "lha e " "pkunzip ") + f  "ck"
  575.           reopen
  576.  
  577.         // view .ZIP or .LZH archives
  578.         when 'v'
  579.           f = getffile
  580.           runcap (if? (pos ".lzh" f 'i') "lha v " "pkunzip -v ") + f
  581.       end
  582.  
  583.     // hotkey to files
  584.     else
  585.       onhotkey c
  586.     end
  587.  
  588.   // File
  589.   key  <ctrl backspace>   fup                  // parent directory
  590.  
  591.   // Mark
  592.   key  <alt m>         fmark "ma"              // mark all files
  593.   key  <alt u>         fmark "ua"              // unmark all
  594.  
  595.   // Command
  596.   key  <enter>         fopen '1'               // open file (one only)
  597.   key  <ctrl enter>    fopen 'q'               // open file (close fmgr)
  598.   key  <del>           fdelete                 // delete file
  599.  
  600.   // Sort
  601.   key  <alt n>         fsort 'n'               // sort by name
  602.   key  <alt s>         fsort 's'               // sort by size
  603.   key  <alt d>         fsort 'd'               // sort by date/time
  604.   key  <alt o>         fsort 'o'               // no sort (DOS order)
  605.  
  606.   // Print
  607.   key  <ctrl p>        print                   // print fmgr contents
  608.   end
  609.  
  610.  
  611. // ───────────────────────────────────────────────────────────────────
  612. //  Movable/Sizable windows
  613. // ───────────────────────────────────────────────────────────────────
  614.  
  615.   object  win
  616.  
  617.   key  <f2>            sizekey                 // move/size with kbd (br)
  618.   key  <ctrl f2>       pankey                  // pan video with kbd
  619.  
  620.   key  <alt ins>       sizewin -2 -1 -2 -1 2   // move window northwest
  621.   key  <alt del>       sizewin  2  1  2  1 2   // move window southeast
  622.   end
  623.  
  624.  
  625. // ───────────────────────────────────────────────────────────────────
  626. //  All windows
  627. // ───────────────────────────────────────────────────────────────────
  628.  
  629.   object  mon
  630.  
  631.   // key macros (br)
  632.   key  <f7>            record                  // toggle record setting
  633.   key  <f8>            play                    // play scrap key macro
  634.  
  635.   // define multi-key prefixes
  636.   key  <ctrl o>        prefix <ctrl o>         // define <ctrl o> prefix
  637.   key  <ctrl q>        prefix <ctrl q>         // define <ctrl q> prefix
  638.  
  639.